package wpRelations;

import java.util.ArrayList;

import processing.core.PApplet;

public class WP_004 extends PApplet {

	/**
	 * @param args
	 */
	
	TsvTable stuffTable;
	String fileName = "Coby_Miller_stuff3.tsv";
	
	
	public void setup() {
		size(1200,400);
		stuffTable = new TsvTable(this, fileName);
		System.out.println("The table " + fileName + " has " + stuffTable.getRowCount() + " rows.");
		System.out.println("The table " + fileName + " has " + stuffTable.data[0].length + " coloumns.");
		//for (int i = 0; i < stuffTable.getRowCount(); i++) {
			for (int i = 0; i < 174; i++) {
			if (!stuffTable.getString(i, 0).equalsIgnoreCase("category")) {
			String from = stuffTable.getString(i, 0);
			String to = stuffTable.getString(i, 1);
			int counter = 0;
			boolean loopFound = false;
			//for (int j = 0; j < fullerTable.getRowCount(); j++) {
			while (counter < stuffTable.getRowCount() && !loopFound) {
			//	while (counter < 174 && !loopFound) {
				if (counter != i) {
				String to2 = stuffTable.getString(counter, 0);
				String from2 = stuffTable.getString(counter, 1);
				if (from2.equalsIgnoreCase(from) && to2.equalsIgnoreCase(to) ) {
					System.out.println("Loop found: " + from + " <-> " + to );
					//return;
					loopFound = true;
				}
				}
				counter++;
				}
			}
			}
			noLoop();
		}
	
	
	
	
	public static void main(String[] args) {
		// TODO Auto-generated method stub

	}

}
